﻿using Sunny.UI;
using System.ComponentModel;
using System.Windows.Forms;

namespace CoreShop.App
{
    //C# WinForm解决Panel控件中的图片刷新时会闪烁的问题
    public partial class YzPanel : UIPanel
    {
        public YzPanel()
        {
            InitializeComponent();

            this.DoubleBuffered = true;//设置本窗体
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
        }

        public YzPanel(IContainer container)
        {
            container.Add(this);

            InitializeComponent();

            this.DoubleBuffered = true;//设置本窗体
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
        }
    }
}
